
/**
 * 自定义键值
 */
export enum InputKeyCode {
    NONE = 0,
    ENTER = 1,
    D = (1 << 1),
    S = (1 << 2),
    BACK = (1 << 3),
    CTRL_LEFT = (1 << 4),
    SHIFT_LEFT = (1 << 5),
    Q = (1 << 6),
    E = (1 << 7),
    ESC = (1 << 8),
    UP = (1 << 9),
    LEFT = (1 << 10),
    DOWN = (1 << 11),
    RIGHT = (1 << 12),
    M = (1 << 13),
    N = (1 << 14),
    B = (1 << 15),
    A = (1 << 16),
    W = (1 << 17),
    SPACE = (1 << 18),
    V = (1 << 19),
    X = (1 << 20),
    C = (1 << 21),
    ALT_LEFT = (1 << 22),
    Del = (1 << 23),
    MOUSE_LEFT = (1 << 25),
    MOUSE_RIGHT = (1 << 26),
    MOUSE_MIDDLE = (1 << 27),

    ROCKER_LEFT = (1 << 30),
    ROCKER_RIGHT = (1 << 31),
}

export class InputType {
    static CC = 'cc'//键盘
    static STEAM = 'steam'//手柄
    static SELF = 'self'
}

export let InputTypeTip = {
    cc: "cc_key",
    steam: 'steam_key'
}
/**
 * 按键对应的值
 */
export const SELF_KEY_CODE = {
    Enter: InputKeyCode.ENTER,
    Menu: InputKeyCode.ESC,
    W: InputKeyCode.W,
    D: InputKeyCode.D,
    S: InputKeyCode.S,
    BACKSPACE: InputKeyCode.BACK,
    LT: InputKeyCode.CTRL_LEFT,
    SHIFT_LEFT: InputKeyCode.SHIFT_LEFT,
    View: InputKeyCode.M,
    N: InputKeyCode.N,
    Y: InputKeyCode.B,
    X: InputKeyCode.V,
    B: InputKeyCode.X,
    A: InputKeyCode.C,
    Up: InputKeyCode.UP,
    Left: InputKeyCode.LEFT,
    Down: InputKeyCode.DOWN,
    Right: InputKeyCode.RIGHT,
    RB: InputKeyCode.E,
    LB: InputKeyCode.Q,
    Del: InputKeyCode.Del,
    MOUSE_LEFT: InputKeyCode.MOUSE_LEFT,
    MOUSE_RIGHT: InputKeyCode.MOUSE_RIGHT,
    MOUSE_MIDDLE: InputKeyCode.MOUSE_MIDDLE,
    RT: InputKeyCode.ALT_LEFT,

    ROCKER_LEFT: InputKeyCode.ROCKER_LEFT,
    ROCKER_RIGHT: InputKeyCode.ROCKER_RIGHT,
}


export enum KeyEventType {
    PRESS,
    RELEASE,
}
//按键组
export enum KeyGroup {
    NONE,
    DEFAULT,//默认
    SAVE,//存档页
    MAIN_CITY,//主城
    EXPLORE_PREPARE,//探索准备
    EXPLORE,//探索
    BATTLE,//战斗
    STORY,//剧情

}

export type KeyMatchInfo = { self: string, cc: string[], steam: string[], cc_key?: string, steam_key?: string, group?: number }
/**
 * 各个平台操作方式的映射表
 */
// export let KeyCodeMatch: KeyMatchInfo[] = [
//     { self: "A", cc: ["Enter", "NumEnter"], steam: ["A"], cc_key: "", steam_key: "", group: 1 },
//     { self: "B", cc: ["Escape"], steam: ["B"], cc_key: "", steam_key: "", group: 1 },
//     { self: "X", cc: ["Z"], steam: ["X"], cc_key: "", steam_key: "", group: 1 },
//     { self: "Y", cc: ["X"], steam: ["Y"], cc_key: "", steam_key: "", group: 1 },
//     { self: "Menu", cc: ["C"], steam: ["Menu"], cc_key: "", steam_key: "", group: 1 },
//     { self: "View", cc: ["M"], steam: ["View"], cc_key: "", steam_key: "", group: 1 },
//     { self: "RB", cc: ["E"], steam: ["RB"], cc_key: "", steam_key: "", group: 1 },
//     { self: "LB", cc: ["Q"], steam: ["LB"], cc_key: "", steam_key: "", group: 1 },
//     { self: "RT", cc: ["ALT_LEFT"], steam: ["RT"], cc_key: "", steam_key: "", group: 1 },
//     { self: "LT", cc: ["CTRL_LEFT"], steam: ["LT"], cc_key: "", steam_key: "", group: 1 },
//     { self: "Up", cc: ["W", "Up"], steam: ["Up"], cc_key: "", steam_key: "", group: 1 },
//     { self: "Left", cc: ["A", "Left"], steam: ["Left"], cc_key: "", steam_key: "", group: 1 },
//     { self: "Down", cc: ["S", "Down"], steam: ["Down"], cc_key: "", steam_key: "", group: 1 },
//     { self: "Right", cc: ["D", 'Right'], steam: ["Right"], cc_key: "", steam_key: "", group: 1 },
// ]


export const InputCtrlModeTips = [
    "0 键鼠",
    "1 手柄"
];